"""
    Contoller for salary base dictionary table.
"""

from mnemoply import model
from mnemoply.controllers.lookup import LookupController, TableCol, TableLookupDataSource
from mnemoply.controllers.crud import CRUDController

class SalaryBaseController(LookupController, CRUDController):
    model_object = model.SalaryBase
    lookup_columns = [
        TableCol(name='organization', caption=_('Organization')),
        TableCol(name='trend', caption=_('Trend')),
        TableCol(name='amount', caption=_('Amount')),
        TableCol(name='year', caption=_('Year')),
    ]
    view_fields = ['organizationID', 'trendID', 'amount', 'year']

    def __init__(self):
        LookupController.__init__(self,
            data_source=TableLookupDataSource('salary_base_lookup'),
            columns=self.lookup_columns,
            title=self.model_object.model_title,
        )
        CRUDController.__init__(self, model_object=self.model_object)

exposed = SalaryBaseController()
